<template>
    <div>
        <el-dialog center class="global-dialog" v-model="dialogVisable" width="1000px"  top="10vh" :show-close="false"
            :close-on-click-modal="false" @close="close">
          <template #title>
            <div class="my-header" v-loading="detail_loading">
              <el-tabs v-model="tabId" class="demo-tabs">
                <el-tab-pane label="流程图" name="12" v-if="flag ==3 && isProcess">
                  <flowChart :processInstanceId="processInstanceId"></flowChart>
                </el-tab-pane>
                <el-tab-pane label="基本信息" name="1">
                  <el-divider content-position="left">
                    <span class="title-line">基本信息</span>
                  </el-divider>
                  <el-form :model="diaForm" ref="DiaForm" :rules="rules" label-width="110px" label-position="top"
                           status-icon>
                    <el-row :gutter="20">
                      <el-col :span="6">
                        <el-form-item label="专家类型" prop="expertType">
                          <el-select v-model="diaForm.expertType" placeholder="请选择" style="width: 100%"
                          @change="changeExpertType" clearable :disabled="flag == 3">
                            <el-option :label="item.itemText" :value="item.itemValue"
                                       :key="item.itemValue" v-for="item in expertTypeList" />
                          </el-select>
                        </el-form-item>
                      </el-col>
                      <el-col :span="6">
                        <el-form-item label="专家姓名" prop="expertName">
                          <user-list-modal style="width: 100%"
                                           v-if="diaForm.expertType == 1" v-model="diaForm.expertName"
                                           @update:modelValue="handleProjectLeader" :default-users="[]"
                                           :multiple="false" :devType="'platform'"  :disabled="flag == 3" />
                          <el-input v-else placeholder="请输入" v-model="diaForm.expertName"
                                    @change="diaForm.employeeId = diaForm.expertName" style="width: 100%"
                                    clearable  maxlength="20" show-word-limit  :disabled="flag == 3"  />
                        </el-form-item>
                      </el-col>
                      <el-col :span="6">
                        <el-form-item label="性别" prop="genderId">
                          <el-select v-model="diaForm.genderId" placeholder="请选择" style="width: 100%"
                                     :disabled="flag == 3" @change="changeGender" clearable>
                            <el-option :label="item.itemText" :value="item.itemValue"
                                       :key="item.itemValue" v-for="item in sexList" />
                          </el-select>
                        </el-form-item>
                      </el-col>

                      <el-col :span="6">
                        <el-form-item label="出生日期" prop="birthdate">
                          <el-date-picker v-model="diaForm.birthdate" type="date" :disabled="flag == 3"
                                          :disabled-date="disabledDate" value-format="YYYY-MM-DD" placeholder="选择日期"
                                          clearable style="width: 100%" @change="changeBirth" />
                        </el-form-item>
                      </el-col>
                    </el-row>
                    <el-row :gutter="20">
                      <el-col :span="6">
                        <el-form-item label="员工编号" prop="employeeCode">
                          <el-input placeholder="请输入" v-model="diaForm.employeeCode" style="width: 100%"
                                    :disabled="flag == 3" clearable maxlength="20" show-word-limit />
                        </el-form-item>
                      </el-col>
                      <el-col :span="6">
                        <el-form-item label="年龄" prop="age">
                          <el-input placeholder="出生日期自动计算" v-model="diaForm.age" disabled>
                            <template v-slot:append>岁</template>
                          </el-input>
                        </el-form-item>
                      </el-col>

                      <el-col :span="6">
                        <el-form-item label="民族" prop="nationId">
                          <el-select clearable v-model="diaForm.nationId" placeholder="请选择"
                                     :disabled="flag == 3" @change="changeNation" style="width: 100%">
                            <el-option :label="item.itemText" :value="item.itemValue"
                                       :key="item.itemText" v-for="item in nationList" />
                          </el-select>
                        </el-form-item>
                      </el-col>

                      <el-col :span="6">
                        <el-form-item label="籍贯" prop="nativePlace">
                          <el-input placeholder="请输入" v-model="diaForm.nativePlace" style="width: 100%"
                                    :disabled="flag == 3" clearable maxlength="50" show-word-limit  />
                        </el-form-item>
                      </el-col>

                    </el-row>
                    <el-row :gutter="20">
                      <el-col :span="6">
                        <el-form-item label="手机号" prop="phone">
                          <el-input placeholder="请输入" v-model="diaForm.phone" style="width: 100%"
                                    :disabled="flag == 3" maxlength="20" clearable />
                        </el-form-item>
                      </el-col>
                      <el-col :span="12">
                        <el-form-item label="工作所在地详细地址" style="width: 100%" prop="workAddress" >
                          <el-input placeholder="请输入" v-model="diaForm.workAddress" style="width: 100%"
                                    :disabled="flag == 3" clearable maxlength="100" show-word-limit  />
<!--                          <el-input placeholder="请输入" v-model="diaForm.workLocation" style="width: 100%"
                                    :disabled="flag == 3" clearable maxlength="100" show-word-limit  />-->
                        </el-form-item>
                      </el-col>
                      <el-col :span="6">
                        <el-form-item label="最高学历" prop="highestDegreeId">
                          <el-select v-model="diaForm.highestDegreeId" placeholder="请选择"
                                     :disabled="flag == 3" @change="changeEducation" style="width: 100%"
                                     clearable>
                            <el-option :label="item.itemText" :value="item.itemValue"
                                       :key="item.itemValue" v-for="item in educationList" />
                          </el-select>
                        </el-form-item>
                      </el-col>
                    </el-row>
                    <el-row :gutter="20">
                      <el-col :span="6">
                        <el-form-item label="所学专业" prop="specialty">
                          <el-input placeholder="请输入" v-model="diaForm.specialty" style="width: 100%"
                                    :disabled="flag == 3" clearable maxlength="50" show-word-limit  />
                        </el-form-item>
                      </el-col>
                      <el-col :span="6">
                        <el-form-item label="毕业院校" prop="graduationSchool">
                          <el-input placeholder="请输入" v-model="diaForm.graduationSchool"
                                    :disabled="flag == 3" style="width: 100%" clearable maxlength="50" show-word-limit   />
                        </el-form-item>
                      </el-col>
                      <el-col :span="6">
                        <el-form-item label="毕业年份" prop="graduationYear">
                          <el-date-picker v-model="diaForm.graduationYear" type="date"
                                          :disabled="flag == 3" :disabled-date="disabledDate"
                                          value-format="YYYY-MM-DD" placeholder="请选择" clearable style="width: 100%" />
                        </el-form-item>
                      </el-col>

                      <el-col :span="6">
                        <el-form-item label="参加工作时间" prop="workStartDate">
                          <el-date-picker v-model="diaForm.workStartDate" type="date"
                                          :disabled="flag == 3" :disabled-date="disabledDate"
                                          value-format="YYYY-MM-DD" placeholder="请选择" clearable style="width: 100%"
                                          @change="changeWorkDate" />
                        </el-form-item>
                      </el-col>
                    </el-row>
                    <el-row :gutter="20">
                      <el-col :span="6">

                        <el-form-item label="工作年限" prop="workExperience">
                          <el-input placeholder="根据参加时间自动计算" v-model="diaForm.workExperience" disabled>
                            <template v-slot:append>年</template>
                          </el-input>
                        </el-form-item>
                      </el-col>

                      <el-col :span="6">
                        <el-form-item label="所属单位" prop="workUnitName">
                          <popup-tree-input v-if="diaForm.expertType == 1" :data="unitList"
                                            :props="popupTreeProps" :prop="deptForm.parentName == null
                                                    ? $t('message.org.top_menu')
                                                    : diaForm.workUnitName
                                                    " :node-key="'' + deptForm.parentId"
                                            :current-change-handle="changeValue8" />
                          <el-input placeholder="所属单位" v-else v-model="diaForm.workUnitName"
                                    style="width: 100%" @change="diaForm.workUnitId = diaForm.workUnitName"
                                    :disabled="flag == 3" clearable />
                        </el-form-item>
                      </el-col>

                      <el-col :span="6">
                        <el-form-item label="所属部门" prop="deptName">
                          <popup-tree-input v-if="diaForm.expertType == 1" :data="unitList1"
                                            :props="popupTreeProps" :prop="deptForm.parentName == null
                                                    ? $t('message.org.top_menu')
                                                    : diaForm.deptName
                                                    " :node-key="'' + deptForm.parentId"
                                            :current-change-handle="changeValue9" />

                          <el-input placeholder="所属部门" v-model="diaForm.deptName" style="width: 100%"
                                    :disabled="flag == 3" clearable @change="diaForm.deptId = diaForm.deptName"
                                    v-else />
                        </el-form-item>
                      </el-col>

                      <el-col :span="6">
                        <el-form-item label="职务" prop="job">
                          <el-input placeholder="请输入" v-model="diaForm.job" style="width: 100%"
                                    :disabled="flag == 3" clearable  maxlength="10" show-word-limit />
                        </el-form-item>
                      </el-col>
                    </el-row>
                    <el-row :gutter="20">
                      <el-col :span="6">
                        <el-form-item label="职称名称" prop="positionId" v-if="diaForm.expertType == 1">
                          <el-select v-model="diaForm.positionId" :disabled="flag == 3" placeholder="请选择"
                                     style="width: 100%" @change="changePosition" clearable>
                            <el-option :label="item.itemText" :value="item.itemValue"
                                       :key="item.itemValue" v-for="item in positonList" />
                          </el-select>
                        </el-form-item>
                        <el-form-item label="职称名称" prop="positionName" v-else>
                          <el-input placeholder="请输入" v-model="diaForm.positionName" :disabled="flag == 3"
                                    style="width: 100%" clearable  maxlength="50" show-word-limit />
                        </el-form-item>
                      </el-col>
                      <el-col :span="6">
                        <el-form-item label="微信号" prop="wechat">
                          <el-input placeholder="请输入" v-model="diaForm.wechat" style="width: 100%"
                                    :disabled="flag == 3" clearable  maxlength="20" show-word-limit />
                        </el-form-item>
                      </el-col>
                      <el-col :span="6">
                        <el-form-item label="固定电话" prop="telephone">
                          <el-input placeholder="请输入" v-model="diaForm.telephone" style="width: 100%"
                                    :disabled="flag == 3" clearable  maxlength="20" show-word-limit />
                        </el-form-item>
                      </el-col>

                      <el-col :span="6">
                        <el-form-item label="电子邮箱" prop="email">
                          <el-input placeholder="请输入" v-model="diaForm.email" style="width: 100%"
                                    :disabled="flag == 3" clearable maxlength="20" show-word-limit  />
                        </el-form-item>
                      </el-col>
                    </el-row>
                    <el-row :gutter="20">
                      <el-col :span="12">
                        <el-form-item label="通讯地址" prop="contactAddress">
                          <el-input placeholder="请输入" v-model="diaForm.contactAddress" style="width: 100%"
                                    :disabled="flag == 3" clearable  maxlength="50" show-word-limit />
                        </el-form-item>

                      </el-col>
                      <el-col :span="6">
                        <el-form-item label="邮政编码" prop="postalCode">
                          <el-input placeholder="请输入" v-model="diaForm.postalCode" style="width: 100%"
                                    :disabled="flag == 3" clearable  maxlength="20" show-word-limit />
                        </el-form-item>
                      </el-col>

                      <el-col :span="6">
                        <el-form-item label="传真" prop="fax">
                          <el-input placeholder="请输入" v-model="diaForm.fax" style="width: 100%"
                                    :disabled="flag == 3" clearable maxlength="20" show-word-limit  />
                        </el-form-item>
                      </el-col>
                    </el-row>
                    <el-divider content-position="left">
                      <span class="title-line">上传中交信息</span>
                    </el-divider>
                    <el-row :gutter="20">
                      <el-col :span="24">
                        <el-form-item label="擅长领域（推荐中交）" prop="reportExpertiseAreaIds">
                          <el-cascader
                              :disabled="flag == 3"
                              style="width: 100%"
                              ref="refCascader"
                              :show-all-levels="false"
                              v-model="diaForm.reportExpertiseAreaIds"
                              :options="sclytwoList"
                              size="small"
                              :props="reportExpertiseAreasprops"
                              @change="reportExpertiseAreasChange"
                              clearable
                              :popper-class="'hide'"

                          />
<!--                       reportExpertiseAreas   <el-input placeholder="擅长领域（推荐中交）" v-model="diaForm.deptName" style="width: 100%"
                                    :disabled="flag == 3" clearable @change="diaForm.deptId = diaForm.deptName"
                                    v-else />-->
                        </el-form-item>
                      </el-col>

                      <el-col :span="8">
                        <el-form-item label="专家等级" style="width: 100%" prop="expertGradeId">
                          <el-select v-model="diaForm.expertGradeId" placeholder="请选择"
                                     :disabled="flag == 3" @change="changeexpertGradeIdselect" style="width: 100%"
                                     clearable>
                            <el-option :label="item.itemText" :value="item.itemValue"
                                       :key="item.itemText" v-for="item in zjdjList" />
                          </el-select>

                        </el-form-item>
                      </el-col>
                      <el-col :span="8">
                        <el-form-item label="是否熟悉海外" style="width: 100%" prop="isForeignId">
                          <el-select v-model="diaForm.isForeignId" placeholder="请选择"
                                     :disabled="flag == 3" @change="changeisForeignIdselect" style="width: 100%"
                                     clearable>
                            <el-option :label="item.itemText" :value="item.itemValue"
                                       :key="item.itemText" v-for="item in sfsxhwList" />
                          </el-select>

                        </el-form-item>
                      </el-col>
                      <el-col :span="8">
                        <el-form-item label="是否熟悉标准化工作" style="width: 100%" prop="isStandardizationWorkId">
                          <el-select v-model="diaForm.isStandardizationWorkId" placeholder="请选择"
                                     :disabled="flag == 3" @change="changeisStandardizationWorkIdselect" style="width: 100%"                                      clearable>
                            <el-option :label="item.itemText" :value="item.itemValue"
                                       :key="item.itemText" v-for="item in sfsxbzhList" />
                          </el-select>

                        </el-form-item>
                      </el-col>
                      <el-col :span="12">
                        <el-form-item label="工作所在地" prop="workLocationId">
                          <el-cascader
                              :disabled="flag == 3"
                              style="width: 100%"
                              ref="refCascaderAddr"
                              :show-all-levels="false"
                              v-model="diaForm.workLocationId"
                              :options="gzszdList"
                              size="small"
                              :props="sourceCascaderprops"
                              @change="handleworkLocationChange"
                              clearable
                              :popper-class="'hide'"

                          /><!---->
                        </el-form-item>
                      </el-col>

                    </el-row>
                  <el-divider content-position="left">
                      <span class="title-line">专家指标及信息</span>
                    </el-divider>
                    <el-row :gutter="20">
                      <el-col :span="24">
                        <el-form-item label="擅长领域" prop="expertiseAreaIds">
                          <el-select v-model="diaForm.expertiseAreaIds" placeholder="请选择"
                                     :disabled="flag == 3" @change="changeselect" style="width: 100%" multiple
                                     clearable>
                            <el-option :label="item.itemText" :value="item.itemValue"
                                       :key="item.itemText" v-for="item in areaList" />
                          </el-select>
                        </el-form-item>
                      </el-col>

                      <el-col :span="24">
                        <el-form-item label="工作业绩概述:" style="width: 100%" prop="workSummary">
                          <el-input v-model="diaForm.workSummary" :rows="3"  maxlength="300" show-word-limit
                                    :disabled="flag == 3" type="textarea" placeholder="300字以内" />
                        </el-form-item>
                      </el-col>

                    </el-row>
                  </el-form>
                </el-tab-pane>
                <el-tab-pane label="工作经历" name="2">
                  <Work :members="diaForm.workExperienceList" @paramsChange="getWorkInfo"
                      :flag="flag" :countryList="countryList" :org-all-list="orgAllList"></Work>
                </el-tab-pane>
                <el-tab-pane label="学习经历" name="3">
                  <Learn :members="diaForm.studyExperienceList" @paramsChange="getStudyInfo"
                      :flag="flag" :educationList="educationList"></Learn>
                </el-tab-pane>
                <el-tab-pane label="学术组织任职" name="4">
                  <Academic :members="diaForm.academicOrganizationList" @paramsChange="getAcademicInfo"
                  :flag="flag" :hjfsList="hjfsList" >
                  </Academic>
                </el-tab-pane>
                <el-tab-pane label="职业资格证书" name="5">
                  <Profession :members="diaForm.professionalCertificateList"
                  :flag="flag" @paramsChange="getProfessInfo">
                  </Profession>
                </el-tab-pane>
                <el-tab-pane label="承担科研的项目" name="6">
                  <Research v-if="dialogVisable" :members="diaForm.researchProjectList" @paramsChange="getResarchInfo"
                  :isChecked="diaForm.data1Flag" :roleList="roleList" :leveltwoList="leveltwoList" :projectTypeList="projectTypeList"
                  :flag="flag" :expertType="diaForm.expertType" :industryClassifyList="industryClassifyList" :businessNatureList="businessNatureList"
                            :projectScaleList="projectScaleList"
                  ></Research>
                </el-tab-pane>
                <el-tab-pane label="科研学术奖励" name="7">
                  <Award v-if="dialogVisable" :members="diaForm.academicAwardList" @paramsChange="getAwardInfo"
                  :flag="flag" :isChecked="diaForm.data2Flag" :hjfsList="hjfsList"
                  ></Award>
                </el-tab-pane>
                <el-tab-pane label="批准专利" name="8">
                  <Approve v-if="dialogVisable" :members="diaForm.patentApprovalList" @paramsChange="getApproveInfo"
                  :flag="flag" :isChecked="diaForm.data3Flag" :expertType="diaForm.expertType"  :classList="classList" :zscqlbList="zscqlbList"   ></Approve>
                </el-tab-pane>
                <el-tab-pane label="发表论文" name="9">
                  <Papers v-if="dialogVisable" :members="diaForm.papersList" @paramsChange="getParperInfo"
                  :flag="flag" :isChecked="diaForm.data4Flag" :expertType="diaForm.expertType" :scoreList="scoreList">
                  </Papers>
                </el-tab-pane>
                <el-tab-pane label="学术著作" name="10">
                  <Journal v-if="dialogVisable" :members="diaForm.journalsList" @paramsChange="getJournalInfo"
                  :flag="flag" :isChecked="diaForm.data5Flag" :expertType="diaForm.expertType"  :levelList="levelList">
                  </Journal>
                </el-tab-pane>
                <el-tab-pane label="其他" name="11">
                  <Other :flag="flag" :members="diaForm.otherAchievementsList" @paramsChange="getOtherInfo"></Other>
                </el-tab-pane>
                <el-tab-pane label="变更记录" name="13" v-if="id">
                  <Record :changeLogs="changeLogs"></Record>
                </el-tab-pane>
              </el-tabs>
            </div>
          </template>
          <template #footer>
            <div class="dialog-footer" style="float:left" v-if="flag == 3 && isProcess && isExamine">
              <el-form  :rules="rulesComment" ref="ruleFormRef" :model="ruleForm">
                <el-form-item label="审批意见" prop="comment">
                  <el-input :rows="2" type="textarea" placeholder="审批意见" v-model="ruleForm.comment"
                            style="width: 450px" clearable />
                </el-form-item>
              </el-form>
            </div>

            <span class="dialog-footer" style="margin-top:20px">
              <el-button @click="close">关闭</el-button>
              <el-button type="primary" @click="save" v-if="flag == 1 || flag == 2">保存</el-button>
              <el-button type="danger" @click="refuse" v-if="flag == 3  && isProcess && isExamine">驳回</el-button>
              <el-button type="primary" @click="pass" v-if="flag == 3  && isProcess && isExamine">通过</el-button>
          </span>
          </template>
        </el-dialog>
    </div>
</template>

<script >
import flowChart from '@/components/PublicProcess/Chart/flowChart.vue';
import {
addForm,
allowProcess,
editForm,
getDetailById,
getDictionary,getbgjltailByiId,
getUser,
refuseProcess
} from "@/views/expert/api/expertsManager";
import { ElAlert,ElLoading  } from 'element-plus';


import * as proxy from "@/constants/proxy";
import request from "@/utils/request";
import UserListModal from '@/views/project/components/UserListModal/index.vue';
import { checkEmailNumber, checkPhoneNumber } from '@/views/science/common/common';
import PopupTreeInput from '@/views/science/components/PopupTreeInput/index.vue';
import PlatformFiles from '@/views/science/components/platformFiles/platformFiles.vue';
import Record from '@/views/expert/components/record/record.vue';
import { Modals, tips } from "@/views/science/components/tips/tips";
import { nextTick, onMounted, reactive, ref, toRefs, watch } from "vue";
import Academic from './academic.vue';
import Approve from './approve.vue';
import Award from './award.vue';
import Journal from './journal.vue';
import Learn from './learn.vue';
import Other from './other.vue';
import Papers from './papers.vue';
import Profession from './profession.vue';
import Research from './research.vue';
import Work from './work.vue';
import { useStore } from 'vuex'
import {defineEmits} from "vue";

import { uniq, uniqBy } from 'lodash'

export default {
    components: {
        PlatformFiles, UserListModal, PopupTreeInput, Record, Work, Learn, Academic, Profession, Research, Award, Approve, Papers, Other, Journal, flowChart, ElAlert
    },
    props: {
        dialogVisable: {
            type: Boolean,
            default: false,
        },
        isProcess: {
            type: Boolean,
            default: false,
        },
        isExamine: {
            type: Boolean,
            default: false,
        },
        // falg  1:新增  2:编辑  3:详情
        flag: {
            type: String || Number,
            default: 1,
        },
        id: {
            type: String,
            default: '',
        },
      orgAllList: {
        type: Array,
        default: () => []
      },
    },
    emits: ['changeDialog:flag'],

    setup(props, { emit }) {

        watch(
            () => props.dialogVisable,

            (value) => {

                nextTick(() => {

                    // 深度监听.只有在id存在的时候调用详情的接口
                    if (props.flag == 1) {
                        data.diaForm.workExperienceList = []
                        data.diaForm.studyExperienceList = []
                        data.diaForm.academicOrganizationList = []
                        data.diaForm.professionalCertificateList = []
                        data.diaForm.researchProjectList = []
                        data.diaForm.academicAwardList = []
                        data.diaForm.patentApprovalList = []
                        data.diaForm.papersList = []
                        data.diaForm.journalsList = []
                        data.diaForm.otherAchievementsList = []
                        data.diaForm.bgjlList = []
                        data.changeLogs=[]
                         initDiaForm()
                        DiaForm.value.resetFields();
                    } else if (props.flag == 2) {

                        getDetail(props.id)
                        getbgjltail(props.id)

                    }
                    else if (props.flag == 3) {

                        getDetail(props.id)
                        if(props.isProcess){
                          data.tabId = '12'
                        }

                    }

                })

            },

            { deep: true, immediate: true }
        );


        // 发送请求
        onMounted(() => {
            // 获取数据字典
            getUserList();

            getUnitList();
            getUnitList1();
            getCodeList();
            getCodeListtwo();
            initDiaForm()

        });

      const checkData = reactive( {
        data1Flag: 1,
        data2Flag: 1,
        data3Flag: 1,
        data4Flag: 1,
        data5Flag: 1,
      })
      const ruleFormRef = ref()
      const refCascader = ref(null)
      const refCascaderAddr = ref(null)

        const ruleForm = reactive({
            comment: '',
        })

        const rulesComment = reactive({
            comment: [
                { required: true, message: '请输入审核意见', trigger: 'change', },
            ]
        })


        let DiaForm = ref();
        let data = reactive({
            dealInVisible: false,
            times: null,
            tabId: '1',
            processInstanceId: '',
            taskId: '',
            expertTypeList: [{ itemValue: '1', itemText: '公司内部专家' }, { itemValue: '2', itemText: '公司外部专家' }],
            expertNameList: [],
            unitList: [],
            unitList1: [],
            levelList: [],
            sexList: [],
            classList: [],
            nationList: [],
            areaList: [],
            educationList: [],
            scoreList: [],
          roleList: [],
          leveltwoList: [],
          hjfsList: [],
          zjdjList: [],
          sfsxhwList: [],
          sfsxbzhList: [],
          gzszdList: [],
          sclyList: [],
          zscqlbList: [],
          projectTypeList: [],
          businessNatureList: [],
          industryClassifyList: [],
          projectScaleList: [],
          sclytwoList: [],

            countryList: [],
            positonList: [],
            userList: [],
            projectList: [],//项目
            technologyList: [],//技术分类
            awardList: [],//软著状态
            popupTreeProps: {
                label: 'name',
                children: 'children',
            },
            diaForm: {},
            sourceCascaderprops: { value: 'itemValue', label: 'itemText', emitPath:false,checkStrictly: false,expandTrigger:'click'},
            reportExpertiseAreasprops: { value: 'itemValue', label: 'itemText', emitPath:false,checkStrictly: false,expandTrigger:'click',multiple:true},

            files: [],
            changeLogs: []
        });
        const initDiaForm = ()=>{
          data.diaForm= {
              type: 1,
              id: '',
              nationId: "",
              nation: "",
              expertType: "",//专家内型
              expertName: "",//专家姓名
              employeeId: "",
              genderId: '',
              gender: "",//性别
              birthdate: "",//出生日期
              employeeCode: '',//员工编号
              workLocation: "",//工作所在地
              nativePlace: '',
              workExperience: "",
              job: '',
              positionId: "",
              positionName: "",
              workUnitId: '',
              workUnitName: '',
              deptId: "",
              deptName: "",
              phone: "",
              highestDegreeId: "",
              highestDegree: "",
              specialty: "",
              graduationSchool: '',
              graduationYear: "",
              workStartDate: '',
              workSummary: "",
              data1Flag: 1,
              data2Flag: 1,
              data3Flag: 1,
              data4Flag: 1,
              data5Flag: 1,
              expertiseAreaIds: [],
              expertiseAreas: [],
              academicOrganizationList: [],
              otherAchievementsList: [],
              patentApprovalList: [],
              professionalCertificateList: [],
              researchProjectList: [],
              studyExperienceList: [],
              workExperienceList: [],
              academicAwardList: [],
              papersList: [],
              journalsList: [],
              expertGradeId:'',
              expertGrade:'',
              isForeignId:'',
              isStandardizationWorkId:'',
              isStandardizationWork:'',
              workLocationId: "",
              reportExpertiseAreaIds: [],
              reportExpertiseAreas: [],
              workAddress:'',
            }
        }
        const deptForm = {
            parentId: 0,
            parentName: '',
        }
        const workLocationForm = {
            parentId: 0,
            parentName: '',
        }

        // 规则校验
        let rules = reactive({
            expertType: [
                { required: true, message: '请选择专家类型', trigger: 'blur' },
            ],
            workUnitName: [
                { required: true, message: '请选择所属单位', trigger: 'blur' },
            ],
            deptName: [
                { required: true, message: '请选择所属部门', trigger: 'blur' },
            ],
            expertName: [
                { required: true, message: '请选择专家姓名', trigger: 'change', },
            ],
            nationId: [
                { required: true, message: '请选择民族', trigger: 'change', },
            ],
            genderId: [
                { required: true, message: '请选择性别', trigger: 'change', },
            ],
            birthdate: [
                { required: true, message: '请选择出生日期', trigger: 'change', },
            ],
            employeeCode: [
                { required: true, message: '请输入员工编号', trigger: 'change', },
            ],
            workAddress: [
                { required: true, message: '请输入工作所在地', trigger: 'change', },
            ],
            job: [
                { required: true, message: '请输入职务', trigger: 'change', },
            ],
            nativePlace: [
                { required: true, message: '请输入籍贯', trigger: 'change', },
            ],
            phone: [
                { required: true, message: '请输入手机号', trigger: 'change' },
                { validator: checkPhoneNumber, trigger: "blur" },
            ],
            highestDegreeId: [
                { required: true, message: '请选择最高学历', trigger: 'change' },
            ],
            positionId: [
                { required: true, message: '请选择职称', trigger: 'change' },
            ],
            positionName: [
                { required: true, message: '请选择职称', trigger: 'change' },
            ],
            specialty: [
                { required: true, message: '请输入所学专业', trigger: 'change' },
            ],
            graduationSchool: [
                { required: true, message: '请输入毕业院校', trigger: 'change' },
            ],
            graduationYear: [
                { required: true, message: '请选择毕业年份', trigger: 'change' },
            ],
            workStartDate: [
                { required: true, message: '请选择参加工作时间', trigger: 'change' },
            ],
            email: [
              { required: true, message: '请输入电子邮箱', trigger: 'change' },
              { validator: checkEmailNumber, trigger: "blur" },
            ],
            expertGradeId: [
              { required: true, message: '请选择专家等级', trigger: 'change' },
            ],
            reportExpertiseAreaIds: [
              { required: true, message: '请选择擅长领域（推荐中交）', trigger: 'change' },
            ],
            isForeignId: [
              { required: true, message: '请选择是否熟悉海外', trigger: 'change' },
            ],
            isStandardizationWorkId: [
              { required: true, message: '请选择是否熟悉标准化工作', trigger: 'change' },
            ],
            workLocationId: [
              { required: true, message: '请选择工作所在地', trigger: 'change' },
            ],
            expertiseAreaIds: [
                { required: true, message: '请选择擅长领域', trigger: 'change' },
            ],


        });
        // watch(()=>data.diaForm.expertType, (newValue, oldValue) => {
        //     data.diaForm.expertName = ''
        //     data.diaForm.employeeId = ''
        // });
        const changeExpertType = ()=>{
            data.diaForm.expertName = ''
            data.diaForm.employeeId = ''
            console.log(data.diaForm.expertType,'diaForm.expertType');
        }
        //驳回
        let refuse = () => {
            ruleFormRef.value.validate(valid => {
                if (valid) {

                    Modals('是否驳回本次内容', '提示', 'warning').then(async () => {

                        refuseProcess({
                            procInsId: data.processInstanceId,
                            comment: ruleForm.comment,
                            businessKey: props.id,
                            businessType: 'YW04',
                            random: (new Date()).valueOf()

                        }).then((res) => {

                            if (res.data.code == 200) {

                                ruleFormRef.value.resetFields();

                                emit("changerRefuse");

                            } else {

                                tips(res.data.message, 'warning')

                            }


                        }).catch(() => {
                            console.log("点击了取消")
                        })

                    })



                }
            })


        }
      const detail_loading = ref(false);
        //通过
        let pass = () => {

            ruleFormRef.value.validate(valid => {
                if (valid) {

                    Modals('是否通过本次内容', '提示', 'warning').then(async () => {

                        allowProcess({
                            procInsId: data.processInstanceId,
                            comment: ruleForm.comment,
                            businessKey: props.id,
                            businessType: 'YW04',
                            random: (new Date()).valueOf()
                        }).then((res) => {

                            if (res.data.code == 200) {
                                ruleFormRef.value.resetFields();

                                emit("changeSuccess");
                            } else {
                                tips(res.data.message, 'warning')
                            }

                        })

                    }).catch((error) => {
                        console.log(error)
                    })

                }
            })

        }

        let dealInCheck = (id) => {

            data.times = setInterval(() => {

                getDetailById(id).then((res) => {


                    let resData = res.data.data

                    if (resData.status == 2 || resData.status == 1) {

                        data.dealInVisible = false

                        emit("changeDialog", '1');

                        clearTimeout(data.times)

                    }

                })

            }, 1000);
        }

        // 保存
        let save = () => {

            DiaForm.value.validate((valid) => {
              if(checkData.data1Flag) {
                if(data.diaForm.researchProjectList.length < 1){
                tips("承担科研的项目中需要至少一条数据", "warning");
                return false;
                }else{
                  let panduan = 0 ;
                  data.diaForm.researchProjectList.forEach(item => {
                    for (let i = 0; i < data.diaForm.researchProjectList.length; i++) {
                      if(item.workContent == '' || item.workContent == null ){
                        panduan = 1;
                      }
                      if(item.projectType == '' || item.projectType == null  ){
                        panduan = 2;

                      }
                      if(item.industryClassify == '' || item.industryClassify == null  ){
                        panduan = 3;
                      }
                      if(item.businessNature == '' || item.businessNature == null  ){
                        panduan = 4;
                      }
                      if(item.projectScale == '' || item.projectScale == null  ){
                        panduan = 5;
                      }
                    }
                  });
                  if(panduan == 1){
                    tips("承担科研的项目中主要工作内容不能为空", "warning");
                    return false;
                  }else if(panduan == 2){
                    tips("承担科研的项目中项目类型不能为空", "warning");
                    return false;
                  }else if(panduan == 3){
                    tips("承担科研的项目中行业分类不能为空", "warning");
                    return false;
                  }else if(panduan == 4){
                    tips("承担科研的项目中经营性质不能为空", "warning");
                    return false;
                  }else if(panduan == 5){
                    tips("承担科研的项目中项目规模不能为空", "warning");
                    return false;
                  }
                }
              }
              if(checkData.data2Flag) {
                if( data.diaForm.academicAwardList.length < 1){
                  tips("科研学术奖励中需要至少一条数据", "warning");
                  // event.stopPropagation();
                  return false;
                }else {
                  let panduan = 0 ;
                  data.diaForm.academicAwardList.forEach(item => {
                    for (let i = 0; i < data.diaForm.academicAwardList.length; i++) {
                      if(item.awardMethodId == null || item.awardMethodId == ''){
                        panduan = 1;
                      }
                    }
                  });
                  if(panduan == 1){
                    tips("科研学术奖励数据中获奖方式不能为空", "warning");
                    // event.stopPropagation();
                    return false;
                  }

                }
              }
              if(checkData.data3Flag) {
                if(data.diaForm.patentApprovalList.length < 1){
                  tips("批准专利中需要至少一条数据", "warning");
                  return false;
                }else {
                  let panduan = 0 ;
                  data.diaForm.patentApprovalList.forEach(item => {
                    for (let i = 0; i < data.diaForm.patentApprovalList.length; i++) {
                      if(item.intellectualPropertyType == '' || item.intellectualPropertyType == null   ){
                        panduan = 1;
                      }
                    }
                  });
                  if(panduan == 1){
                    tips("代表性专利中知识产权类别不能为空", "warning");
                    return false;
                  }

                }
              }
              if(checkData.data4Flag) {
                if(data.diaForm.papersList.length < 1){
                  tips("发表论文中需要至少一条数据", "warning");
                  return false;
                }else {
                  let panduan = 0 ;
                  data.diaForm.papersList.forEach(item => {
                    for (let i = 0; i < data.diaForm.papersList.length; i++) {
                      if(item.isMasterWork == '' || item.isMasterWork == null  ){
                        panduan = 1;
                      }
                    }
                  });
                  if(panduan == 1){
                    tips("发表论文中知识产权类别不能为空", "warning");
                    return false;
                  }

                }
              }
              if(checkData.data5Flag) {
                if(data.diaForm.journalsList.length < 1){
                  tips("学术著作中需要至少一条数据", "warning");
                  return false;
                }else {
                  let panduan = 0 ;
                  data.diaForm.journalsList.forEach(item => {
                    for (let i = 0; i < data.diaForm.journalsList.length; i++) {
                      if(item.isMasterWork == '' || item.isMasterWork == null  ){
                        panduan = 1;
                      }
                    }
                  });
                  if(panduan == 1){
                    tips("学术著作中是否代表作不能为空", "warning");
                    return false;
                  }

                }
              }
              console.log(props.flag,'props.flag');

                // 校验通过
                if (valid) {
                    //flag 1 新增  2 编辑  3  详情
                    if (props.flag == 1) {

                      data.diaForm.id = '';
                      console.log(checkData,'checkData');
                      for(let key in checkData){
                        data.diaForm[key] = checkData[key]
                      }
                      detail_loading.value = true;
                        addForm(
                            // {...data.diaForm, ...checkData}
                            {...data.diaForm}
                        ).then(() => {

                            tips("新增成功", "success");
                            data.diaForm.positionName=''
                            data.diaForm.positionId=''
                            DiaForm.value.resetFields();

                            emit("changeDialog", '1');

                        }).finally(() => detail_loading.value = false);


                    } else {
                      console.log(checkData,'checkData');

                      for(let key in checkData){
                        data.diaForm[key] = checkData[key]
                      }
                      detail_loading.value = true;
                        editForm(
                            // {...data.diaForm, ...checkData}
                            {...data.diaForm}
                        ).then(() => {

                            tips("编辑成功", "success");
                            data.diaForm.positionName=''
                            data.diaForm.positionId=''
                            // DiaForm.value.resetFields();

                            emit("changeDialog", '1');
                        }).finally(() => detail_loading.value = false);

                    }
                } else {

                    return tips('请将基本信息补充完整', 'warning')

                }


            });
        }
        // 通过详情查询id
        let getDetail = async (id) => {
          detail_loading.value = true;
            let res = await getDetailById(id);
            detail_loading.value = false;
            console.log(data.diaForm,res.data.data,'getgetDetailByIdDetail');
            data.diaForm = res.data.data
            console.log(checkData,'checkData');
            for(let key in checkData){
               checkData[key] = data.diaForm[key]
            }
            data.processInstanceId = res.data.data.processInstanceId
            data.taskId = res.data.data.taskId
        };
        // bgjlList查询id

        let getbgjltail = async (alterid) => {
            let res = await getbgjltailByiId(alterid);
            console.log(11111111111111111111111111,res.data.data)
            data.changeLogs = res.data.data
        };
        const store = useStore()

        // 技术分类/软著状态===>数据字典
        let getCodeListtwo = () => {
          if (store.state.expert.gzszdList.length == 0) {
            const loading = ElLoading.service({
              lock: true,
              text: '加载字典数据',
            })
            getDictionary(["ZJYRC_GZSZD",]).then((res) => {
              console.log("data.gzszdList2",data.gzszdList)
              data.gzszdList = res.data.data.ZJYRC_GZSZD;
              store.state.expert.gzszdList = res.data.data.ZJYRC_GZSZD
              loading.close()
              console.log("data.gzszdList3",data.gzszdList)
            }).catch(()=>{
                loading.close()
              })
          }else{
            data.gzszdList = store.state.expert.gzszdList
          }
        };
        let getCodeList = () => {
            if (Object.keys(store.state.expert.expertDialogDict).length == 0) {
              const loading = ElLoading.service({
                  lock: true,
                  text: '加载字典数据',
                })
              getDictionary(["ZJYRCZJ_SCLYTWO","ZJYRC_XMGM","ZJYRC_JYXZ","ZJYRC_HYFL","ZJYRC_XMLX","ZJYRC_ZSCQLB","ZJYRCZJ_SCLY","ZJYRC_SFSXBZ","ZJYRC_SFSXHW","ZJYRC_ZJDJ","ZJYRC_HJFS","KJSL_MEMBER_ROLE","XMZX_LEVEL_TYPE",'ZJYRC_ZJLX', 'SEX', 'NATIONALITY', 'EDUCATION', 'ZJYRC_ZCMC', 'ZJYRC_SCLY', 'ZJYRC_SZGL', 'KJSL_PATENT_TYPE', 'KJSL_ACADEMIC_WORK_LEVEL', "KJSL_BUSINESS_SECTOR",]).then((res) => {
                loading.close()
                store.state.expert.expertDialogDict = res.data.data
                initDict(res.data.data)
              }).catch(()=>{
                loading.close()
              })
            }else{
              initDict(store.state.expert.expertDialogDict)
            }
        };
        const initDict = (dictData)=>{
            data.sclytwoList = dictData.ZJYRCZJ_SCLYTWO;
            data.projectScaleList = dictData.ZJYRC_XMGM;
            data.businessNatureList = dictData.ZJYRC_JYXZ;
            data.industryClassifyList = dictData.ZJYRC_HYFL;
            data.projectTypeList = dictData.ZJYRC_XMLX;
            data.zscqlbList = dictData.ZJYRC_ZSCQLB;
            data.sclyList = dictData.ZJYRCZJ_SCLY;
            // data.gzszdList = dictData.ZJYRC_GZSZD; "ZJYRC_GZSZD",
            data.sfsxbzhList = dictData.ZJYRC_SFSXBZ;
            data.sfsxhwList = dictData.ZJYRC_SFSXHW;
            data.zjdjList = dictData.ZJYRC_ZJDJ;
            data.hjfsList = dictData.ZJYRC_HJFS;
            data.roleList = dictData.KJSL_MEMBER_ROLE;
            data.leveltwoList = dictData.XMZX_LEVEL_TYPE;
            data.sexList = dictData.SEX;
            data.nationList = dictData.NATIONALITY;
            data.educationList = dictData.EDUCATION;
            data.positonList = dictData.ZJYRC_ZCMC;
            data.areaList = dictData.ZJYRC_SCLY;
            data.countryList = dictData.ZJYRC_SZGL;
            data.classList = dictData.KJSL_PATENT_TYPE;
            data.scoreList = dictData.KJSL_BUSINESS_SECTOR;
            data.levelList = dictData.KJSL_ACADEMIC_WORK_LEVEL;
        }
        let getWorkInfo = (parms) => {

            data.diaForm.workExperienceList = parms

        }


        let getStudyInfo = (parms) => {

            data.diaForm.studyExperienceList = parms

        }

        let getAcademicInfo = (parms) => {

            data.diaForm.academicOrganizationList = parms

        }

        let getProfessInfo = (parms) => {

            data.diaForm.professionalCertificateList = parms

        }

        let getOtherInfo = (parms) => {

            data.diaForm.otherAchievementsList = parms

        }

        let getResarchInfo = (parms) => {
          data.diaForm.researchProjectList = parms.list ? parms.list : []
          checkData.data1Flag = Number(!parms.checked)
          console.log(checkData.data1Flag,parms,'getResarchInfo');
        }
        let getAwardInfo = (parms) => {
          data.diaForm.academicAwardList = parms.list ? parms.list : []
          checkData.data2Flag = Number(!parms.checked)
          console.log(checkData.data2Flag,parms,'getAwardInfo');
        }
        let getApproveInfo = (parms) => {
          data.diaForm.patentApprovalList = parms.list ? parms.list : []
          checkData.data3Flag = Number(!parms.checked)
          console.log(checkData.data3Flag,parms,'getApproveInfo');
        }
        let getParperInfo = (parms) => {
          data.diaForm.papersList  =  parms.list ? parms.list : []
          checkData.data4Flag = Number(!parms.checked)
          console.log(checkData.data4Flag,parms,'getParperInfo');
        }
        let getJournalInfo = (parms) => {
          data.diaForm.journalsList =  parms.list ? parms.list : []
          checkData.data5Flag = Number(!parms.checked)
          console.log(checkData.data5Flag,parms,'getParperInfo');
        }


        // 项目

        let getUserList = () => {

            getUser({}).then((res) => {

                data.userList = res.data.data;
            });
        };



        let changeEducation = (id) => {
            let itemText = data.educationList.find((item) => item.itemValue == id).itemText;
            data.diaForm.highestDegree = itemText
        }
        // 职务Name
        let changePosition = (id) => {
            let itemText = data.positonList.find((item) => item.itemValue == id).itemText;
            data.diaForm.positionName = itemText
        }

        let changeGender = (id) => {
            let itemText = data.sexList.find((item) => item.itemValue == id).itemText;
            data.diaForm.gender = itemText
        }

        let changeNation = (id) => {
            let itemText = data.nationList.find((item) => item.itemValue == id).itemText;
            data.diaForm.nation = itemText
        }

        let handleProjectLeader = (user) => {
            data.diaForm.expertName = user.cname
            data.diaForm.employeeId = user.userId
            getPeople(user.userCode)
        }

        const getPeople = (id) => {
            return request({
                url: proxy.CHECC_API_CMS + "/user/getList",
                method: "post",
                data: { empcode: id },
            }).then(res => {
                console.log('res', res.data.data.records[0]);
                let resdata = res.data.data.records[0]
                data.diaForm.genderId = resdata.gender
                data.diaForm.gender = resdata.gendertext
                data.diaForm.employeeCode = resdata.empcode
                data.diaForm.birthdate = resdata.birth.substring(0, 10)
                //根据出生日期算年龄
                if (data.diaForm.birthdate) {
                    let birthDayTime = new Date(data.diaForm.birthdate).getTime();
                    let nowTime = new Date().getTime();
                    data.diaForm.age = Math.ceil((nowTime - birthDayTime) / 31536000000)
                }
                data.diaForm.nationId = resdata.nationDict
                data.diaForm.employeeCode = resdata.empcode
                data.diaForm.nation = resdata.nation
                data.diaForm.phone = resdata.phone
                data.diaForm.highestDegreeId = resdata.educationDict
                data.diaForm.highestDegree = resdata.educationBackground
                data.diaForm.specialty = resdata.typeOfWork
                data.diaForm.workStartDate = resdata.hiredate.substring(0, 10)
                //参加工作时间
                if (data.diaForm.workStartDate) {
                    let DayTime = new Date(data.diaForm.workStartDate).getTime();
                    let nowTime = new Date().getTime();
                    data.diaForm.workExperience = Math.ceil((nowTime - DayTime) / 31536000000)
                }
                data.diaForm.workUnitName = resdata.orgname
                data.diaForm.workUnitId = resdata.orgid
                data.diaForm.deptName = resdata.deptName
                data.diaForm.deptId = resdata.deptId
                data.diaForm.job = resdata.selectOrgs
                // data.diaForm.positionId = resdata.technicalDict
                data.diaForm.positionName = resdata.technicalTitle
                data.diaForm.email = resdata.email
            })
        }
        let changeselect = (val) => {
            let arr = []
            data.areaList.forEach(item => {
                for (let i = 0; i < val.length; i++) {
                    if (item.itemValue == val[i]) {
                        arr.push(item.itemText)
                    }
                }
            })
            data.diaForm.expertiseAreas = arr
        }
        let changeexpertGradeIdselect = (id) => {
          let itemText = data.zjdjList.find((item) => item.itemValue == id).itemText;
          data.diaForm.expertGrade = itemText
        }
        let changeisForeignIdselect = (id) => {
          let itemText = data.sfsxhwList.find((item) => item.itemValue == id).itemText;
          data.diaForm.isForeign = itemText

        }
        let changeisStandardizationWorkIdselect = (id) => {
          let itemText = data.sfsxbzhList.find((item) => item.itemValue == id).itemText;
          data.diaForm.isStandardizationWork = itemText
        }
        let changeworkLocationIdselect = (id) => {
          let itemText = data.gzszdList.find((item) => item.itemValue == id).itemText;
          data.diaForm.workLocation = itemText
        }
        const changeValueworkLocation = (item) => {
          data.diaForm.workLocationId = item.id
          data.diaForm.workLocation = item.name
        }
        /*
              const handleworkLocationChange = (value) => {
          const nodes = refCascaderAddr.value.getCheckedNodes?.() || [];
          const selectNodes = uniqBy(nodes.reduce((now, next) => now.concat(next.pathNodes || []), []), 'value');
          console.log('选中后的完整数据源：', selectNodes);
          console.log('选中后的完整label：', selectNodes.map(t => t.label));
          // TODO 拿到数据后做你想做的业务
          data.diaForm.workLocationId = selectNodes;
          data.diaForm.workLocation = selectNodes.map(t => t.label);


        }
        const reportExpertiseAreasChange = (value) => {
          const nodes = refCascader.value.getCheckedNodes?.() || [];
          const selectNodes = uniqBy(nodes.reduce((now, next) => now.concat(next.pathNodes || []), []), 'value');
          console.log('选中后的完整数据源：', selectNodes);
          console.log('选中后的完整label：', selectNodes.map(t => t.label));
          // TODO 拿到数据后做你想做的业务
          data.diaForm.reportExpertiseAreasId = selectNodes;
          data.diaForm.reportExpertiseAreas = selectNodes.map(t => t.label);

        } */
        const handleworkLocationChange = () => {
          console.log("data.gzszdList1",data.gzszdList)
          // getDictionary(["ZJYRC_GZSZD",]).then((res) => {
          //   console.log("data.gzszdList2",data.gzszdList)
          //   data.gzszdList = res.data.data.ZJYRC_GZSZD;
          //   console.log("data.gzszdList3",data.gzszdList)
          // });
          data.diaForm.workLocation = (refCascaderAddr.value.getCheckedNodes?.() || [])[0]?.label || "";
        }
        const reportExpertiseAreasChange = () => {
          data.diaForm.reportExpertiseAreas = (refCascader.value.getCheckedNodes?.() || []).map(t => t.label) || [];
        }

        //   出生计算年龄
        let changeBirth = (value) => {
            let birthDayTime = new Date(value).getTime();
            let nowTime = new Date().getTime();
            data.diaForm.age = Math.ceil((nowTime - birthDayTime) / 31536000000)
        }

        let changeWorkDate = (value) => {
            let DayTime = new Date(value).getTime();
            let nowTime = new Date().getTime();
            data.diaForm.workExperience = Math.ceil((nowTime - DayTime) / 31536000000)
        }

        let disabledDate = (date) => {
            return date.getTime() > Date.now();
        };

        // 单位公司
        let getUnitList = () => {
            return request({
                url: proxy.CHECC_API_CMS + "/org/getSysOrgList",
                method: "get",
            }).then(res => {
                data.unitList = res.data.data
            })
        };
        // 部门
        let getUnitList1 = () => {
            return request({
                url: proxy.CHECC_API_CMS + "/org/tree",
                method: "get",
            }).then(res => {
                data.unitList1 = res.data.data
            })
        };

        // 关闭清除对话框里面的数据,附件.变更记录也要删除
        let close = () => {
            if (props.flag == 3 && props.isProcess && props.isExamine) {
                ruleFormRef.value.resetFields();
            }
            data.tabId = '1';
            data.diaForm.positionName=''
            data.diaForm.positionId=''
          // dialogVisable=false
            emit("changeDialog");
            // initDiaForm()
          // DiaForm.value.resetFields();

        };
        const changeValue8 = (item) => {
            data.diaForm.workUnitId = item.id
            data.diaForm.workUnitName = item.name
        }
        const changeValue9 = (item) => {
            data.diaForm.deptId = item.id
            data.diaForm.deptName = item.name
        }

        return {
            disabledDate,
            DiaForm,
            deptForm,
            changeValue8,
            changeValue9,
            getUnitList,
            getUnitList1,
            getWorkInfo,
            getStudyInfo,
            getAcademicInfo,
            getProfessInfo,
            getOtherInfo,
            getResarchInfo,
            getAwardInfo,
            getParperInfo,
            getJournalInfo,
            getApproveInfo,
            rules,
            getUserList,
            getCodeList,
           getCodeListtwo,
            changeEducation,
            changePosition,
            changeselect,
            changeBirth,
            changeWorkDate,
            changeGender,
            changeNation,
            ...toRefs(data),
            close,
            save,
            ruleForm,
            rulesComment,
            pass,
            dealInCheck,
            ruleFormRef,
            refuse,
            changeExpertType,
            handleProjectLeader,
          detail_loading,
          changeexpertGradeIdselect,
          changeisForeignIdselect,
          changeisStandardizationWorkIdselect,
          changeworkLocationIdselect,
          workLocationForm,
          handleworkLocationChange,
          refCascader,
          refCascaderAddr,
          reportExpertiseAreasChange,
        };
    },
};
</script>

<style scoped lang="scss">
.title-line {
    color: #409EFF;
}

.dialog-footer {
    display: flex;
    justify-content: end;
}

:deep(.el-dialog__body) {
    display: none;
}

// 滚动条
:deep(.demo-tabs > .el-tabs__content) {
    max-height: 500px;
    overflow-y: scroll;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
</style>
